<?php
/**
 * Created by PhpStorm.
 * User: ownfi
 * Date: 2017-03-21
 * Time: 11:33
 */

namespace App\Http\Controllers\Api;


use App\Common\Constant\Status;
use App\Services\IAreaService;
use App\Services\ISystemService;

class AreaController extends BaseController
{

    /**
     * 获取省份id、名称键值对
     * @param ISystemService $systemService
     * @return mixed
     */
    public function getProvinceCouple(IAreaService $areaService){
        return $this->renderJson(Status::SUCCESS,$areaService->getProvinceCouple());
    }

    /**
     * 获取城市id、名称键值对
     * @param ISystemService $systemService
     * @return mixed
     */
    public function getCityCouple($provinceId,IAreaService $areaService){
        return $this->renderJson(Status::SUCCESS,$areaService->getCityCouple($provinceId));
    }

    /**
     * 获取区县id、名称键值对
     * @param ISystemService $systemService
     * @return mixed
     */
    public function getDistrictCouple($cityId,IAreaService $areaService){
        return $this->renderJson(Status::SUCCESS,$areaService->getDistrictCouple($cityId));
    }

}